/*
 * @Descripttion: 加工单
 * @version: V1.0
 * @Author: GaoWei
 * @Date: 2021-04-25 12:11:55
 * @LastEditors: GW
 * @LastEditTime: 2021-12-20 14:10:58
 */
import { axios } from '../../utils/request'

/**
 * 生产加工
 */
const api = {
    save: '/production/work/save',
    examine: '/production/work/examine',
    delete: '/production/work/delete',
    getcode: '/production/work/getCode',
    getDetails: '/production/work/detailMap',
    getBomDetails: '/production/dispatch/listLeafDetailByMother',
    getClDetails: '/production/work/listByProductionWorkId',//获取加工单材料明细

    // 生产制造 统计
    pageProductionWorkCumSummaryVo: '/production/work/pageProductionWorkCumSummaryVo', //统计：生产订单执行汇总表
    pageProductionWorkCumDetailVo: '/production/work/pageProductionWorkCumDetailVo', //统计：生产订单执行明细表
    pageProductionPickReturnCumSummaryVo: '/production/work/pageProductionPickReturnCumSummaryVo', //统计：生产订单领料汇总表
    pageProductionPickReturnCumDetailVo: '/production/work/pageProductionPickReturnCumDetailVo', //统计：生产订单领料明细表
    pageProductionPickAbnormalVo: '/production/work/pageProductionPickAbnormalVo', //统计：生产领料异常表
    pageProductionPickAbnormalSumVo: '/production/work/pageProductionPickAbnormalSumVo', //统计：生产领料差异汇总表
    pageProductionMonthInVo: '/production/work/pageProductionMonthInVo', //统计：生产入库月报表
    pageProductionPickReturnMonthSummaryVo: '/production/work/pageProductionPickReturnMonthSummaryVo', //统计：生产领料月报表


}
/**
 * 保存
 */
export function save (data) {
    return axios({
        url: api.save,
        method: "post",
        data: data
    })
}

/**
 * 审核
 */
export function examine (data) {
    return axios({
        url: api.examine,
        method: "get",
        params: data
    })
}

/**
 * 删除
 */
export function remove (data) {
    return axios({
        url: api.delete,
        method: "DELETE",
        params: data
    })
}

/**
 * 获取单据编号
 */
export function getCode (data) {
    return axios({
        url: api.getcode,
        method: "get",
        params: data
    })
}

/**
 * 通过加工单ID 获取加工单所有明细的 物料明细 和 工序明细
 */
export function getIdDetails (data) {
    return axios({
        url: api.getDetails,
        method: "get",
        params: data
    })
}

/**
 * 根据bomID获取尾阶 物料需求量
 */
export function getBomDetails (data) {
    return axios({
        url: api.getBomDetails,
        method: "get",
        params: data
    })
}

/**
 * 获取委外加工单材料明细
 */
export function getClDetails (data) {
    return axios({
        url: api.getClDetails,
        method: "get",
        params: data
    })
}

/**
 * 单据提交
 */
export function submitOrder (data) {
    return axios({
        url: '/production/work/submit',
        method: "get",
        params: data
    })
}


/**
 * 统计：生产订单执行汇总表
 */
 export function pageProductionWorkCumSummaryVo (data) {
    return axios({
        url: api.pageProductionWorkCumSummaryVo,
        method: "post",
        data: data
    })
}

/**
 * 统计：生产订单执行明细表
 */
 export function pageProductionWorkCumDetailVo (data) {
    return axios({
        url: api.pageProductionWorkCumDetailVo,
        method: "post",
        data: data
    })
}

/**
 * 统计：生产订单领料汇总表
 */
 export function pageProductionPickReturnCumSummaryVo (data) {
    return axios({
        url: api.pageProductionPickReturnCumSummaryVo,
        method: "post",
        data: data
    })
}

/**
 * 统计：生产订单领料明细表
 */
 export function pageProductionPickReturnCumDetailVo (data) {
    return axios({
        url: api.pageProductionPickReturnCumDetailVo,
        method: "post",
        data: data
    })
}

/**
 * 统计：生产领料异常表
 */
 export function pageProductionPickAbnormalVo (data) {
    return axios({
        url: api.pageProductionPickAbnormalVo,
        method: "post",
        data: data
    })
}
/**
 * 统计：生产领料差异汇总表
 */
 export function pageProductionPickAbnormalSumVo (data) {
    return axios({
        url: api.pageProductionPickAbnormalSumVo,
        method: "post",
        data: data
    })
}
/**
 * 统计：生产入库月报表
 */
 export function pageProductionMonthInVo (data) {
    return axios({
        url: api.pageProductionMonthInVo,
        method: "post",
        data: data
    })
}

/**
 * 统计：生产领料月报表
 */
 export function pageProductionPickReturnMonthSummaryVo (data) {
    return axios({
        url: api.pageProductionPickReturnMonthSummaryVo,
        method: "post",
        data: data
    })
}

